<%
response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","no-cache");
response.setDateHeader("Expires",0);
%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<%@ page language="java" import='java.util.ArrayList'%>
<%@ page language="java" import='java.util.List'%>
<%@ page language="java" import='com.dgac.licencias.to.*'%>
<%@ page language="java" import='java.text.DecimalFormat'%>
<html><head><title>LISTADO DE CLIENTES</title>
<meta http-equiv="Content-Type" content="text/html; charset=unicode"><link 
href="/WebLicencias/css/espacio.css" type=text/css rel=stylesheet>
<link 
href="/WebLicencias/css/calendar-system.css" type=text/css rel=stylesheet>
<script language="javascript" src="/WebLicencias/js/calendar.js"></script>
<script language="javascript" type="text/javascript" src="/WebLicencias/js/js.Farmacia.Function.js"></script>
<script language="javascript" src="/WebLicencias/js/calendar-es.js"></script>
<script language="javascript" src="/WebLicencias/js/utils.js"></script>

<script language="javascript">
setResizableElements('res');
    function validarMenu(menu){
        if(menu=="1"){
		   document.frmCliente.submit();
        }else{
        	   document.getElementById('idTabla2').style.display="none"; 
		   document.getElementById('idTabla1').style.display="inline"; 
        }
    }
     function Editar(CodComp){

      //var isOk=confirm("Confirmar la edición el registro?");
       //alert(CodLic);
      //if (isOk==true){ 
        //var cliente=document.frmLicencia.cliente.value;
        //var result=window.showModalDialog("EditClienteLicencia.jsp",false,'dialogHeight:360px;dialogWidth:480px;');
        var result=window.showModalDialog("/WebLicencias/verComprobantePago.do?txtcodcomp="+CodComp+"&indpago=S",false,'dialogHeight:360px;dialogWidth:520px;');
        if(result=="editado"){
          document.frmCliente.metodo.value="refresh";
          document.frmCliente.txtcodcomp.value=0;
          document.frmCliente.action="/WebLicencias/verPagosPendientes.do";
          document.frmCliente.submit();
        }
       
      //}          
    } 
</script>

<meta content="MSHTML 6.00.6000.16945" name="GENERATOR"></head>
<body>
<% 
 // Validacion de Sesion
 UsuarioTO usuario=(UsuarioTO) session.getAttribute("usr");
 if(usuario==null){%>
  <jsp:forward page="Login.jsp" /> 
<%}
%>    
<table width="98%" align="center" bgcolor="#fffdd6" border="0">
     <form action="/WebLicencias/verPagosPendientes.do" id="frmCliente" name="frmCliente">      
     <INPUT TYPE="HIDDEN" NAME="codcli" VALUE="<%=usuario.getCliente().getCodCliente()%>">
     <INPUT TYPE="HIDDEN" NAME="txtcodcomp" VALUE="">
     <INPUT TYPE="HIDDEN" NAME="metodo" VALUE="insert">   
  <tbody>
  <tr><strong></strong></tr>
  <tr><strong></strong></tr>
  <tr>
    <td class="TextoPortal" align="middle" colspan="4"><font 
      color=#004080><strong>CONSULTA DE PAGOS PENDIENTES</strong></font></td></tr>
  <tr>
    <td class="TextoPortal" align="middle" colspan="4"><input class="boton" onclick="validarMenu('1');" type="button" value="Consultar" name="Submit22">&nbsp; 
    </td></tr></tbody></table>

<div id="idTabla2" style="DISPLAY: inline">
<table width="98%" align="center" bgcolor="#fffdd6" border="0">
  <tbody>
  <tr>
    <td>
      <div id="res"> <br>
      <table class="consultanormal" id="row" cellspacing="0" width="98%" 
        align=center><thead>
        <tr>
          <th class="sortable" width="13%">PAGAR</th>
          <th class="sortable" width="10%"><a href="#"><font 
            color=#ffffff>Serie</font></a></th>
          <th class="sortable" width="11%"><a href="#"><font color="#ffffff">No 
            Docu</font></a></th>
          <th class="sortable" width="15%"><a href="#"><font color="#ffffff">Fecha 
            Vencimiento</font></a></th>
          <th class="sortable" width="12%"><a href="#"><font 
            color=#ffffff>Moneda</font></a></th>
          <th class="sortable" width="12%"><a href="#"><font 
            color=#ffffff>Monto</font></a></th>
          <th class="sortable" width="12%"><a href="#"><font 
            color=#ffffff>Glosa</font></a></th></tr></thead>
        <tbody>
        <%
           ArrayList listcomp = (ArrayList) request.getSession().getAttribute("listcomp");
           int hits=0;
           String consulta="";
           
           if (listcomp!=null) {
           consulta="NO PRESENTA DEUDAS";    
           hits=listcomp.size(); 
           for (int i = 0; i < listcomp.size(); i++) {
                    ComprobantePagoTO comp = (ComprobantePagoTO) listcomp.get(i);
                    String[] clase = {"odd","even"};
         %>
        
        <tr class="<%=(clase[i%2])%>">
          <td>
            <div align="center"><img title="Modificar" style="CURSOR: hand" 
            onclick="Editar(<%= comp.getCodComprobante() %>);" 
            height=15 src="/WebLicencias/imagenes/boton_modificar.gif" width=15 
            align=middle border=0>&nbsp;</div></td>
          <td class="TextoTabla8">
            <div align="center"><%= comp.getSerieDocu() %></div></td>
          <td class="TextoTabla8">
            <div align="center"><%= comp.getNumDocu() %></div></td>
          <td class="TextoTabla8">
            <div align="center"><%= comp.getSfecha_vcmnto() %></div></td>
          <td class="TextoTabla8">
            <div align="center"><%= comp.getDesc_moneda() %></div></td>
          <td class="TextoTabla8">
            <div align="center"><%= comp.getDesc_monto() %></div></td>
          <td class="TextoTabla8">
            <div align="center">&nbsp;<%= comp.getGlosa() %></div></td></tr>
            <%
          }
        }
           if(hits==0){
            %> 
            <tr class="odd">
          <td colspan="7">
            <div align="center" >&nbsp;<%=consulta%></div></td>
          </tr>
           <%
           }
          %>   
            </tbody></table><br>
     <br><br></div></td></tr></tbody></form></table></div>
<script language="javascript">
highlightTableRows('row');
</script>
</body></html>
